var mySwiper = new Swiper('.top', {
    slidesPerView: 3,
});
var tabSwiper = new Swiper('.bottom', {
    speed: 500,
    initialSlide: 0,
    onSlideChangeStart: function (tabSwiper) {
        var index = tabSwiper.activeIndex;
        $(".top .active").removeClass('active');
        $(".top .swiper-slide").eq(index).addClass('active');
        mySwiper.slideTo(index);
    }
});
$(".top .swiper-slide").on('click', function (e) {
    e.preventDefault();
    var $this = $(this);
    if (!$this.hasClass('active')) {
        $(".top .active").removeClass('active');
        $(this).addClass('active');
        tabSwiper.slideTo($(this).index());
        mySwiper.slideTo($(this).index());
    }
});
$.ajax({
    url:"../json/wantbuy.json",
    type:"get",
    success:function(date){
        //console.log(res);
        var str = template('text',{att:date});
        $('.list').html(str);
    }
    
})
$('.fa').click(function(){
    location.href = 'fabu.html';
})